package tiandang.core.service;

import tiandang.core.error.BusinessException;
import tiandang.core.form.ProductForm;
import tiandang.core.model.OrderProduct;
import tiandang.core.model.Product;

import java.util.List;

public interface ProductService {

  Object getList(String name, Integer currentPage, Integer limit);

  Product getProductById(Integer id);

  void setDownline(Integer id, Integer downline);

  void createProduct(ProductForm productForm) throws BusinessException;

  void modifyProduct(ProductForm productForm) throws BusinessException;

  void delete(Integer id);

  //库存扣减
  void decreaseStock(List<OrderProduct> orderProductList) throws BusinessException;

  //库存增加
  void increaseStock(List<OrderProduct> orderProductList) throws BusinessException;

  //商品销量增加
  void increaseSales(List<OrderProduct> orderProductList) throws BusinessException;

  //商品销量减少
  void decreaseSales(List<OrderProduct> orderProductList) throws BusinessException;

  List<Product> getListByProductIdList(List<Integer> productIdList);

  List<Product> getAllNormal();
}
